<?php
include_once 'connect.php';
$id = $_GET['id'];
$icon= $_GET['icon'] ?? '';
$name = $_GET['name'];

if (is_numeric($id)){
    $sql = "delete from lovelist where id = $id";
    $result = mysqli_query($connect,$sql);
    if ($result){
        echo "<script>alert('删除事件成功');location.href = '/admin/lovelist.php';</script>";
    }else{
        echo "<script>alert('删除内容失败)';history.back();</script>";
    }
}else{
    echo "<script>alert('参数错误');history.back();</script>";
}